CS 6110 Lecture 36 A Monadic Approach to

نویسنده

  • Andrew Myers
چکیده

It is also possible to define monads in terms of two other operations, map : (D → E) → M(D) → M(E) and join : M(M(D))→M(D). This is often the approach taken in category theory, but the definitions are equivalent. We use the notation [σ] to denote unit(σ), and the notation f∗(m) to denote bind(f)(m). Monads figure heavily in the programming language Haskell, which uses monads as a way to introduce impure computation effects into what is otherwise a mostly pure functional language (modulo divergence). The unit operation is called return in Haskell, and the bind operation is written as >>=. Haskell also supports syntactic sugar that makes monads look like imperative code.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Advanced Programming Languages CS 6110 Spring 2012 Lecture 1

Goals of the Course This course is designed to teach the elements of a mathematically rigorous semantics for programming languages. Based on this semantics it is possible to prove that certain programming languages behave according to precise mathematical rules if they are implemented properly. It is also possible to prove that compilers implementing these languages are correct [13] according t...

متن کامل

CS 6110 Lecture 7 Well - Founded Induction 9 February 2009

Recall that some of the substitution rules mentioned the function FV : {λ-terms} → Var: FV(x) = {x} FV(e1 e2) = FV(e1) ∪ FV(e2) FV(λx. e) = FV(e)− {x}. Why does this definition uniquely determine the function FV? There are two issues here: • Existence: whether FV is defined on all λ-terms; • Uniqueness: whether the definition is unique. Of relevance here is the fact that there are three clauses...

متن کامل

CS 6110 Lecture 7 Well - Founded Induction 6 February 2013 Lecturer :

Recall that some of the substitution rules mentioned the function FV : {λ-terms} → Var: FV(x) = {x} FV(e1 e2) = FV(e1) ∪ FV(e2) FV(λx. e) = FV(e)− {x}. Why does this definition uniquely determine the function FV? There are two issues here: • Existence: whether FV is defined on all λ-terms; • Uniqueness: whether the definition is unique. Of relevance here is the fact that there are three clauses...

متن کامل

ar X iv : 1 40 1 . 53 91 v 1 [ cs . P L ] 2 1 Ja n 20 14 The semantic marriage of monads and effects Extended abstract Dominic Orchard

Wadler and Thiemann unified type-and-effect systems with monadic semantics via a syntactic correspondence and soundness results with respect to an operational semantics. They conjecture that a general, “coherent” denotational semantics can be given to unify effect systems with a monadic-style semantics. We provide such a semantics based on the novel structure of an indexed monad, which we intro...

متن کامل

Cs 6604: Data Mining

In the last lecture we discussed the relationships between different modeling paradigms such as the Bayesian approach, Maximum A Posteriori (MAP) approach, Maximum Likelihood (ML) approach, and the Leastsquares (LS) method. In this lecture we first prove that equivalence of LS and ML under the assumption of normally distributed error. Then, the notions of the naive Bayesian classifier and the L...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2013